
   
	<cfcomponent displayname="libAccess Service" hint="">

	<cffunction name="init" access="public" returntype="libAccessService" output="false">

		<cfreturn this/>

	</cffunction>

	<cffunction name="setlibAccessGateway" returntype="void" access="public" output="false" hint="dependency: libAccessGateway">
		<cfargument name="libAccessGateway" type="libAccessGateway" required="true"/>
		<cfset variables.m_libAccessGateway = arguments.libAccessGateway/>
	</cffunction>

	<cffunction name="setlibAccessDAO" returntype="void" access="public" output="false" hint="dependency: libAccessDAO">
		<cfargument name="libAccessDAO" type="libAccessDAO" required="true"/>
		<cfset variables.m_libAccessDAO = arguments.libAccessDAO/>
	</cffunction>

	<cffunction name="getAll" returntype="query" access="public" output="false" hint="I retrieve all existing libAccess">

		<cfreturn variables.m_libAccessGateway.getAll()/>
	</cffunction>

	<cffunction name="getById" returntype="any" access="public" output="false" hint="I retrieve a libAccess">
		<cfargument name="userId" type="string" required="true"/>
		<cfargument name="LibId" type="numeric" required="true"/>
		<cfreturn variables.m_libAccessDAO.read(arguments.userID, arguments.LibId)/>
	</cffunction>
	
	<cffunction name="getCheckAccess" returntype="any" access="public" output="false" hint="I retrieve a libAccess">
		<cfargument name="LibId" type="numeric" required="true"/>
		<cfargument name="userId" type="string" required="true"/>
		<cfreturn variables.m_libAccessGateway.getCheckAccess(userid=arguments.userID, libid=arguments.LibId)/>
	</cffunction>

	<cffunction name="save" returntype="any" access="public" output="false" hint="I save a libAccess">
		<cfargument name="libAccess" type="libAccess" required="true"/>
		<cfreturn variables.m_libAccessDAO.save(arguments.libAccess)/>
	</cffunction>

	<cffunction name="remove" returntype="void" access="public" output="false" hint="I remove a libAccess">
		<cfargument name="libAccess" type="libAccess" required="true"/>
		<cfreturn variables.m_libAccessDAO.remove(arguments.libAccess)/>
	</cffunction>
	
	<cffunction name="deleteByUserID" access="public" returntype="void" output="false" displayname="" hint="">
		<cfargument name="userid" type="string" required="true" />		
		<cfreturn variables.m_libAccessGateway.deleteByUserID(arguments.userid)/>
	</cffunction>
	
</cfcomponent>
	
  
